const app = getApp();
Page({
  onShow() {
    this.getLiveHistoryList();
  }, 
  
  goDetail(e) {
    app.util.navigateTo('cm_onlineclass/pages/live-history/video-review?roomid=' + e.currentTarget.dataset.roomid);
  },

  getLiveHistoryList() {
    const options = {
      url: 'entry/wxapp/tic',
      data: {
        op: 'getTeachers',
      },
      method: 'get',
      cachetime: 0,
    };
    const success = res => {
      this.setData({ liveHistory: res.data.data.list });
    };
    const fail = msg => {
      console.log(msg);
    };
    this.doRequest(options, success, fail);
  },

  doRequest(options, success = null, fail = null) {
    app.util.request({
      ...options,
      module: 'cm_onlineclass',
      success,
      fail,
    });
  },
});